package com.show;


import com.show.filter.HTTPBearerAuthorizeAttribute;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

import java.util.ArrayList;
import java.util.List;


/**
 * 主程序入口
 *
 * @author liukai
 */
@SpringBootApplication
public class EntryApplication {

    public static void main(String[] args) {
        SpringApplication.run(EntryApplication.class, args);
        System.out.println("$$$$$$$$$$$$$$$$");
        System.out.println("启动成功！");
        System.out.println("$$$$$$$$$$$$$$$$");
    }
    /**
     * token认证拦截器注册，想要拦截的add，测试时注掉即可
     * @author 王玉涛
     * @Param
     * @date 2017/7/29 16:48
     */
    @Bean
    public FilterRegistrationBean jwtFilterRegistrationBean(){
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        HTTPBearerAuthorizeAttribute httpBearerFilter = new
                HTTPBearerAuthorizeAttribute();
        registrationBean.setFilter(httpBearerFilter);
        List<String> urlPatterns = new ArrayList();
//        设置拦截对象
//        urlPatterns.add("/app/*");
//        urlPatterns.add("/emp/*");
//        urlPatterns.add("/grid/*");
//        urlPatterns.add("/grid/*");
        urlPatterns.add("/abcx/*");

        registrationBean.setUrlPatterns(urlPatterns);
        return registrationBean;
    }

}